home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_introscene.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  254 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_IntroScene.cog
  4. #
  5. # [SXC & revised by HB]
  6. #
  7. # Mini-cutscene at the start of Teotihuacan: 
  8. #
  9. # RT 10/5/98: SwapMeshes switched to Set/RestoreThingMesh()
  10. #
  11. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  12. #
  13. # ==============================================================================
  14.  
  15. symbols
  16.  
  17.     message     startup
  18.     message     user0
  19.     message     timer
  20.     message     entered
  21.     message        arrived
  22.     message     crossed
  23.     message     callback
  24.     
  25.     keyframe    in_handsONhips=0in_stand4.key            local
  26.     keyframe    in_sideTOhips=0in_stand1_bd_4.key           local
  27.     keyframe    in_rub=0in_rubhead_4_4.key                local # 129x
  28.     
  29.     model          in_head=head_in_goodhair.3do              local
  30.     model          in_hand_hat=hand_in_hat.3do                  local
  31.  
  32.     sound       introwav=mus_teo_intro.wav                # defined in Marcus
  33.     sound       indylines                                # defined in Marcus
  34.     sound       doorsound                                # defined in Marcus
  35.     sound       doorstopsound                            # defined in Marcus
  36.         
  37.     surface     hitface0                                linkid=3
  38.     surface     hitface1                                linkid=3
  39.     surface     hitface2                                linkid=3
  40.     surface     hitface3                                linkid=3
  41.     
  42.     surface     saysurf
  43.       
  44.     thing        player                                  local
  45.  
  46.     thing       mark0
  47.     thing       door0             
  48.     thing       camera0                                    nolink
  49.     thing       camera1                                    nolink                        
  50.     
  51.     sector      startsector
  52.     sector      startsector1
  53.     sector      cutsector
  54.           
  55.     vector      forcething
  56.     vector        v_targetpos                                local
  57.  
  58.     flex        speed=1.0
  59.     flex        doorSpeed=0.5
  60.     flex        waittime=3.0    
  61.     
  62.     int         cursound                                local
  63.     int         enterflag=0                             local
  64.     int         bnosound=0                              local
  65.     int         in_track0                               local
  66.     int         in_track1                               local
  67.  
  68.     int            bSwapped=0                                local
  69.     int            swapRefHead                                local
  70.     int            swapRefHat                                local
  71.     int            swapRefHand                                local
  72.  
  73.     int            bSeen=0                                    local
  74.         
  75. end
  76.  
  77. # ==============================================================================
  78.  
  79. code
  80.  
  81. # ..............................................................................
  82.  
  83. startup:
  84.  
  85.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  86.  
  87.     Sleep(0.001); # Let engine get set up
  88.  
  89.     # Start on black...
  90.     SetCameraLookInterp(2, 0); # no t or p
  91.     SetCameraPosInterp(2, 0); # no dolly
  92.     SetCameraFocus(2, camera0);
  93.     SetCameraSecondaryFocus(2, mark0);
  94.     SetCurrentCamera(2);
  95.     SetCameraFOV(35, 0, 0);
  96.     SetThingAlpha(player, 1.0);
  97.  
  98.     return;
  99.  
  100. # ..............................................................................
  101.  
  102. user0: # RT: Indicates that autosave/restore has completed...
  103.  
  104.     if (bSeen) return; # RT
  105.     bSeen = 1;
  106.  
  107.     player = GetLocalPlayerThing();
  108.  
  109.     enterflag = 0;
  110.     ClearThingFlags(player, 0x80000);
  111.     SetActorFlags(player, 0x200000);
  112.     SetThingAlpha(player, 1.0);
  113.     SetTimer(0.01);  # sets a timer to bypass startup camera
  114.     StartCutscene(2);
  115.  
  116.     return;
  117.  
  118. # ..............................................................................
  119.  
  120. timer:
  121.  
  122.     if (enterflag == 0)
  123.     {
  124.         # Start the opening cutscene action here...
  125.         ClearThingFlags(player, 0x4000); # shadow off
  126.         SetCameraLookInterp(2, 0); # no t or p
  127.         SetCameraPosInterp(2, 0); # no dolly
  128.         SetCameraFocus(2, camera0);
  129.         SetCameraSecondaryFocus(2, mark0);
  130.         SetThingAlpha(player, 1.0);
  131.         SetCurrentCamera(2);
  132.         SetCameraFOV(35, 0, 0);
  133.         MoveToFrame(door0, 1, doorSpeed);
  134.         PlaySoundLocal(introwav, 0.75, 0, 0x0, 0);           
  135.     }
  136.     
  137.     if (enterflag == 1)
  138.     {
  139.         # Clean up & end cutscene here...
  140.         ResetCameraFOV(0, 0.0);
  141.         SetCameraLookInterp(2, 0);
  142.         SetCameraPosInterp(2, 0);
  143.  
  144.         # Make a camera position near Indy to prep follow-cam...            
  145.         v_targetpos =
  146.             VectorAdd(VectorTransformToOrient(player, '0.2 -0.05 0.0'), GetThingPos(player));    
  147.         SetCameraPosition(1, v_targetpos);
  148.         Sleep(0.1);
  149.  
  150.         SetCurrentCamera(1);
  151.         DeselectWeaponWait(player);
  152.         EndCutscene();
  153.         ClearActorFlags(player, 0x200000);
  154.     }
  155.  
  156.     return;
  157.     
  158. # ..............................................................................
  159.  
  160. arrived:    
  161.                                                     
  162.      if (GetSenderRef() == door0)
  163.     {
  164.         # Continue scene when the door is fully open...
  165.         SetSectorThrust(startsector, forcething, speed);
  166.         PlayMode(player, 2, 0);
  167.         SetCameraPosInterp(2, 1);
  168.         SetThingAlpha(player, 1.0);
  169.     }
  170.  
  171.     return;
  172.     
  173. # ..............................................................................
  174.  
  175. crossed:
  176.  
  177.     if (GetSenderRef() == saysurf)
  178.     {
  179.         Sleep(1);
  180.         SetSectorThrust(startsector1, forcething, (speed*2));
  181.     }
  182.  
  183.     return;
  184.  
  185. # ..............................................................................
  186.  
  187. entered:
  188.  
  189.     if (GetSenderRef() == cutsector)
  190.     {
  191.         SetCameraFOV(90, 0, 0);
  192.         SetCameraFocus(2, camera1);
  193.         SetCameraSecondaryFocus(2, player);
  194.         SetCurrentCamera(2);
  195.     }        
  196.         
  197.     if ((GetSenderID() == 3) && (bnosound == 0))
  198.     {
  199.         # Indy hits the floor...
  200.         StopThing(player);
  201.         CaptureThing(player);
  202.         SetThingFlags(player, 0x4000); # shadow on
  203.         bnosound = 1;
  204.         Sleep(1.0);
  205.  
  206.         # Indy: "...Pyramid of the Sun...except...not too sunny in here."
  207.         cursound = PlayVoice(player, indylines, 1.0, 0);
  208.  
  209.         in_track0 = PlayKey(player, in_handsONhips, 2, 0x0, 0);
  210.         PlayKey(player, in_sideTOhips, 4, 0x12, 1);
  211.         in_track1 = PlayKey(player, in_rub, 4, 0x12, 0); # 4.3 sec
  212.         Sleep(3.9);
  213.         StopKey(player, in_track0, 0.5);
  214.         StopKey(player, in_track1, 0.5);
  215.         SelectWeapon(player, 13);
  216.         WaitForSound(cursound);
  217.         enterflag = 1;
  218.         SetTimer(2.5);
  219.     }
  220.  
  221.     return;
  222.     
  223. # ..............................................................................
  224.  
  225. callback:
  226.  
  227.     if (!bSwapped)
  228.     {
  229.         swapRefHead = SetThingMesh(player, 8, in_head, 0);
  230.         swapRefHat = SetThingMesh(player, 9, in_head, 1);
  231.         swapRefHand = SetThingMesh(player, 15, in_hand_hat, 0);
  232.  
  233.         # RT: Set up no-hat heads...
  234.         SetThingVoiceHeads(player, "inhead", "head_in_goodhair.3do", "head_in_asound_gh.3do", "head_in_amsound_gh.3do", "head_in_osound_gh.3do");
  235.     }
  236.     else
  237.     {
  238.         RestoreThingMesh(player, swapRefHead);
  239.         RestoreThingMesh(player, swapRefHat);
  240.         RestoreThingMesh(player, swapRefHand);
  241.  
  242.         # RT: Restore default heads...
  243.         SetThingVoiceHeads(player, "inhead", "", "head_in_asound.3do", "head_in_amsound.3do", "head_in_osound.3do");
  244.  
  245.         ReleaseThing(player);
  246.     }
  247.  
  248.     bSwapped = 1 - bSwapped;
  249.  
  250.     return;
  251.     
  252. end
  253.  
  254.